package com.nkzy.domain.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

//统一结果返回类：类中有属性、方法
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {

    private Integer code;//状态码，此处可以使用int、Integer
    private String message;//提示信息
    private Object data;//数据


    public static Result success(Object data) {
        ;
        return new Result(200, "操作成功", data);
    }

    public static Result success(String msg) {
        return new Result(1, "操作成功", null);
    }
}







